<!--<{script src="datapicker.js" app="b2c" pdir="js"}>
<{script src="moo_min.js" app="desktop" pdir="js_mini"}>
<{script src="moo.min.js" app="site" pdir="js_mini"}>

<{css src="mydate.css" app="b2c"}>-->
<!--<{lang_script src="lang.js" app='desktop'}>
<{script src="loader.js" app="desktop"}>
<{script src="coms/datapicker.js" app='desktop' }>修改组合在一起的js-->

<{script src="laydate.js" app="b2c" pdir="js"}>
<!-- 供应商信息 -->
<div class="page-article" id="businessbasic">
	<!-- 供应商信息维护 -->
    <div class="member_welhead"><ins></ins><b><{t}>供应商信息维护<{/t}></b> </div>
	<form action="<{link app=b2c ctl='site_member' full='1' act='save_baseinfo'}>" method="post" class="form-handling" >
		<input type="hidden" value="<{$business.business_id}>" name="business_id">

			<div class="form-group">
				<label for="" ><em class="red">*</em> <{t}>中文全称：<{/t}></label>
				<input type="text" name="business[chinese_all_name]" id="" value="<{$business.chinese_all_name}>" class="x-input form-control" vtype="required">
			</div>
			<div class="form-group">
				<label for=""><em class="red">*</em> <{t}>英文全称：<{/t}></label>
				<input type="text" name="business[english_all_name]" id="" value="<{$business[english_all_name]}>" class="x-input form-control" vtype="required">
			</div>
			<div class="form-group">
				<label for=""><em class="red">*</em> <{t}>在俄公司全称：<{/t}></label>
				<input type="text" name="business[russia_all_name]" id="" value="<{$business[russia_all_name]}>" class="x-input form-control" vtype="required" >
			</div>
			<div class="form-group">
				<label for=""><em class="red">*</em> <{t}>公司地址：<{/t}></label>
				<{input type="region" name="business[company_area]" required="true" value=$business[company_area] app="ectools" callback="selectArea" class="form-control"}>

				<input type="text" name="business[company_addr]" value="<{$business[company_addr]}>" id="" size="50" class="x-input form-control action-fill-area" vtype="required">
			</div>
			<div class="form-group">
				<label for=""><em class="red">*</em> <{t}>联系人姓名(俄语)：<{/t}></label>
				<input type="text" name="business[company_rname1]" value="<{$business[company_rname1]}>" id="" class="x-input form-control" vtype="required">
			</div>
			<div class="form-group">
				<label for=""><em class="red">*</em> <{t}>联系人姓名(汉语)：<{/t}></label>
				<input type="text" name="business[company_cname1]" value="<{$business[company_cname1]}>" id="" class="x-input form-control" vtype="required">
			</div>
			<div class="form-group">
				<label for=""><em class="red">*</em> <{t}>联系人电话：<{/t}></label>
				<div class="row">
				<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
				<{if $phones}>
				<select name="business[phone_setting1]" id="quhao" onchange="checkPerfix(this)" class="form-control">
					<{foreach from=$phones item=items}>
						<option sid="<{$items.length}>" value="<{$items.area}>"<{if $items.area == $business.phone_setting1}>selected="selected"<{/if}>><{$items.country}><{$items.area}></option>
					<{/foreach}>
				</select>
			  <{/if}>
			  </div>
			  <div class="col-lg-9 col-md-9 col-sm-9 col-xs-9">
				<input type="text" name="business[company_tel1]" value="<{$business[company_tel1]}>" id="" class="x-input form-control" vtype="required" >
				</div>
				</div>
			</div>
			
			<div class="form-group">
				<label for="" ><{t}>联系人微信：<{/t}></label>
				<input type="text" name="business[company_weixin1]" value="<{$business[company_weixin1]}>" id="" class="x-input form-control">
			</div>
			<div class="form-group">
				<label for="" ><{t}>联系人姓名(俄语)：<{/t}></label>
				<input type="text" name="business[company_rname2]" value="<{$business[company_rname2]}>" id="" class="x-input form-control">
			</div>
			<div class="form-group">
				<label for="" ><{t}>联系人姓名(汉语)：<{/t}></label>
				<input type="text" name="business[company_cname2]" value="<{$business[company_cname2]}>" id="" class="x-input form-control">
			</div>
			<div class="form-group">
				<label for=""><{t}>联系人电话：<{/t}></label>
				<div class="row">
				<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
				<{if $phones}>
				<select name="business[phone_setting2]" id="quhao2" onchange="checkPerfix2(this)" class="form-control">
					<{foreach from=$phones item=items}>
					<option sid="<{$items.length}>" value="<{$items.area}>"<{if $items.area == $business.phone_setting2}>selected="selected"<{/if}>><{$items.country}><{$items.area}></option>
					<{/foreach}>
				</select>
			  <{/if}>
			  </div>
				<div class="col-lg-9 col-md-9 col-sm-9 col-xs-9">
				<input type="text" name="business[company_tel2]" value="<{$business[company_tel2]}>" id="" class="x-input form-control">
				</div>
				</div>
			</div>
			<div class="form-group">
				<label for="" ><{t}>联系人微信：<{/t}></label>
				<input type="text" name="business[company_weixin2]" value="<{$business[company_weixin2]}>" id="" class="x-input form-control" >
			</div>

				<label for="" ><{t}>出货仓库类型：<{/t}></label>
				<div class="radio-inline">
				<label>
				<input type="radio" name="business[depot_type]" value=0 <{if $business.depot_type==0}>checked<{/if}>><{t}>Lublino<{/t}>
				</label>
				</div>
				<div class="radio-inline">
				<label>
				<input type="radio" name="business[depot_type]" value=1 <{if $business.depot_type==1}>checked<{/if}>><{t}>HY仓库<{/t}>
				</label>
				</div>
				<div class="radio-inline">
				<label>
				<input type="radio" name="business[depot_type]" value=2 <{if $business.depot_type==2}>checked<{/if}>><{t}>其他<{/t}>
				</label>
				</div>

			<div class="form-group">
				<label for=""><{t}>出货仓库地址：<{/t}></label>
				<input type="text" name="business[depot_addr]" value="<{$business[depot_addr]}>" id="" class="x-input form-control" >
			</div>
			<div class="form-group">
				<label for=""><{t}>Lublino店铺编号：<{/t}></label>
				<input type="text" name="business[lnumber]" value="<{$business[lnumber]}>" id="" class="x-input form-control" >
			</div>
			<div class="form-group">
				<label for="" ><{t}>商检证到期日期：<{/t}></label>
				<!--<span class="form-act"><{input type="date" name="business[check_time]" value=$business.check_time|date:'d-m-Y' style="width:200px"}></span>-->
				<{input type="text" id="check_time" class="form-control"}><img src="<{$env.base_url}>/public/app/b2c/statics/images/icon.png" id="J-xl-2-btn" style="cursor:pointer; float: right;padding-top:2px;"/><p style="height:1px"><{input type="text" id="hid" value=$business.check_time|cdate name="business[check_time]" style="border:0;width:1px;height:1px;"}></p>
				<div class="clearfix"></div>
			</div>
			<div class="form-group">
				<label for=""><{t}>是否有代理授权：<{/t}></label>
				<div class="radio-inline">
				<label>
				<input type="radio" name="business[is_agency]" value="true" <{if $business.is_agency=="true"}>checked<{/if}>><{t}>是<{/t}>
				</label>
				</div>
				<div class="radio-inline">
				<label>
				<input type="radio" name="business[is_agency]" value="false" <{if $business.is_agency=="false"}>checked<{/if}>><{t}>否<{/t}>
				</label>
				</div>
			</div>
				<div class="form-group">	
				<label for="" ><{t}>CRM客户编码：<{/t}></label>
				<input type="text" name="business[crm_number]" value="<{$business[crm_number]}>" id="" class="x-input form-control" >
				</div>
				<div class="form-group">
				<label for="" ><{t}>是否为物流客户：<{/t}></label>
				<div class="radio-inline">
				<label>
				<input type="radio" name="business[is_wuliu]" value="true" <{if $business.is_wuliu=="true"}>checked<{/if}>><{t}>是<{/t}>
				</label>
				</div>
				<div class="radio-inline">
				<label>
				<input type="radio" name="business[is_wuliu]" value="false" <{if $business.is_wuliu=="false"}>checked<{/if}>><{t}>否<{/t}>
				</label>
				</div>
				<div class="clearfix"></div>
				</div>
				
				<div class="form-group">
				<label for=""><{t}>库存确认：<{/t}></label>
				<div class="radio-inline">
				<label>
				<input type="radio" name="business[is_share]" value="true" <{if $business.is_share=="true"}>checked<{/if}>><{t}>需要<{/t}>
				</label>
				</div>
				<div class="radio-inline">
				<label>
				<input type="radio" name="business[is_share]" value="false" <{if $business.is_share=="false"}>checked<{/if}>><{t}>不需要<{/t}>
				</label>
				</div>
				<div class="clearfix"></div>
				</div>
	
					<button type="submit" class="btn btn-primary pull-right action-confirm" rel="_request"><span><span><{t}>保存<{/t}></span></span></button>
				<div class="clearfix"></div>


	</form>
</div>
<script>
window.addEvent('domready',function(){
	var val = $("hid").get('value');
	val = changetime(val);
	$("check_time").set('value',val);
});

$('businessbasic').getElement('.action-confirm').store('_ajax_config', {
	progress: function(rs) {
        var type = ['success','error'], i = type.length;
        for(;i --;) {
            var v = type[i], msg = v === 'success' ? rs[v] : rs[v];
            if(!msg) continue;
            return Message(msg, v, callback);
        }
        function callback() {
            if(rs.redirect) location.href = rs.redirect;
        }
    }
});

document.getElementById('J-xl-2-btn').onclick = function(){
	laydate({
		elem: '#hid',
		choose: function(datas){ //选择日期完毕的回调
			var s = changetime(datas);
			$("check_time").set('value',s);
		}
	});
}

function changetime(str){
    var strings = str.split('-');
	var arr = new Array(3);

	arr[2] = strings[0];
	arr[1] = strings[1];
	arr[0] = strings[2];
	return arr.join('-');
}

</script>